package com.manong.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.manong.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author 李茂鑫
 * @Date 2025/1/8 11:07
 * @Descripition
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Delete("delete from sys_user_role where user_id = #{userId}")
    int deleteUserRole(Long userId);

    /**
     * 保存用户角色关系
     * @param userId
     * @param roleId
     * @return
     */
    int saveUserRole(Long userId, List<Long> roleId);

}
